<?php
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/jquery.validate.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/user/update-password.js');
?>
<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'user-form',
        'enableAjaxValidation' => false,
            ));
    ?>
    <?php
    foreach (Yii::app()->user->getFlashes() as $key => $message) {

        if ($key == 'error') {
            echo '<div class="alert in alert-block fade alert-error">' . $message . "</div>\n";
        } else {
            echo '<div class="alert in alert-block fade alert-success">' . $message . "</div>\n";
        }
    }
    ?>

    <p class="error-details">

    </p>   
    <div class="row">
        <?php echo $form->labelEx($model, 'new_password'); ?>
        <?php echo $form->passwordField($model, 'new_password', array('size' => 60, 'maxlength' => 100, 'class' => 'new-password')); ?>
        <?php echo $form->error($model, 'new_password'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'repeat_password'); ?>
        <?php echo $form->passwordField($model, 'repeat_password', array('size' => 60, 'maxlength' => 100, 'class' => 'repeat-password')); ?>
        <?php echo $form->error($model, 'repeat_password'); ?>
    </div>
    <div class="row buttons">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array("id" => "updatePassword")); ?>
    </div>
    
    <?php $this->endWidget(); ?>

</div><!-- form -->
